home *** CD-ROM | disk | FTP | other *** search
/ Racing Games (Spidla) / zavodni.iso / Fun Racing / src / FRAClass.h next >
Encoding:
C/C++ Source or Header  |  2003-06-19  |  2.6 KB  |  108 lines

  1.  
  2.  
  3. #ifndef FRACLASS_H
  4. #define FRACLASS_H
  5.  
  6. #include "FRCar.h"
  7.  
  8. class FRAClass : public FRCar
  9. {
  10.     TERTTIDeclaration;
  11.  
  12. public:
  13.  
  14.     FRAClass(TEVector &rCenter, Float fInitYRot)
  15.     {
  16.         TEOBoundingBox *pOBox = new TEOBoundingBox;
  17.         TEAABoundingBox BBox;
  18.         TEVector Min, Max;
  19.         TEEngine *pEngine = TEEngine::GetEngine();
  20.         TESoundManager* pSound = TESoundManager::GetSoundManager();
  21.         TEString Name;
  22.         
  23.         Name = "motor1.ogg";
  24.         m_pMotor = pSound->GetSound(Name);
  25.         Name = "brake.ogg";
  26.         m_pBraking = pSound->GetSound(Name);
  27.         Name = "horn1.ogg";
  28.         m_pHorn = pSound->GetSound(Name);
  29.         
  30.         m_fMass = 1200.0f;
  31.  
  32.         m_fMaxRPM = 5000.0f;
  33.         m_fRotFactor = 120.0f;
  34.  
  35.         m_ulNumGears = 5;
  36.         m_aGears = new FRGearInfo[5];
  37.  
  38.         m_aGears[0].fRPMChange = 3000.0f;
  39.         m_aGears[0].fRPMTrans = -100.0f;
  40.         m_aGears[1].fRPMChange = 3500.0f;
  41.         m_aGears[1].fRPMTrans = 120.0f;
  42.         m_aGears[2].fRPMChange = 2500.0f;
  43.         m_aGears[2].fRPMTrans = 130.0f;
  44.         m_aGears[3].fRPMChange = 500.0f;
  45.         m_aGears[3].fRPMTrans = 250.0f;
  46.         m_aGears[4].fRPMChange = 150.0f;
  47.         m_aGears[4].fRPMTrans = 450.0f;
  48.  
  49.         m_Rotation = TEVector(0.0f, fInitYRot, 0.0f);
  50.  
  51.         m_pModelRef = TEModelManager::GetModelManager()->GetModel("a-class.tmf");
  52.         TEAssert(m_pModelRef);
  53.  
  54.         m_pModelRef->SetAnimation(0);
  55.         m_pModelRef->SetTimeScale(0);
  56.         m_pModelRef->SetLoopAnimation(true);
  57.         
  58.         BBox = m_pModelRef->GetModelBBox();
  59.         BBox.GetData(Min, Max);
  60.         m_CarSize = Max - Min;
  61.  
  62.         m_Center.m_fX = m_OldCenter.m_fX = rCenter.m_fX;
  63.         m_Center.m_fY = m_OldCenter.m_fY = m_fDeltaY = TEAbs(Min.m_fY) + 0.05f;
  64.         m_Center.m_fZ = m_OldCenter.m_fZ = rCenter.m_fZ;
  65.  
  66.         pOBox->SetData(m_Center, Min, Max, m_Rotation);
  67.  
  68.         m_pBoundingVolume = pOBox;
  69.  
  70.         m_fFrontAxis = 0.0f;
  71.         m_fRearAxis = -31.0f;
  72.  
  73.         m_fWheelWidth = 3.5f;
  74.         m_fWheelMov = 1.75f;
  75.  
  76.         m_aLightPos[0] = TEVector(-6.00f, -0.2f,  21.5f);
  77.         m_aLightPos[1] = TEVector( 5.75f, -0.2f,  21.5f);
  78.         m_aLightPos[2] = TEVector(-5.65f,  0.0f, -21.5f);
  79.         m_aLightPos[3] = TEVector( 6.00f,  0.0f, -21.5f);
  80.  
  81.         m_fBrakeEfficiency = 16.0f;
  82.  
  83.         UpdateVectors();
  84.  
  85.         if(ms_bSmoke)
  86.         {
  87.             TEVector Center = m_pBoundingVolume->GetCenter();
  88.             TEVector Tmp = Center + m_aExhaustPos[0].m_fX * m_Right +
  89.                 m_aExhaustPos[0].m_fY * m_Up + m_aExhaustPos[0].m_fZ * m_Forward;
  90.             
  91.             m_usNumExhaust = 1;
  92.             m_aExhaustPos[0] = TEVector(-2.8f, -5.0f, -23.0f);
  93.             
  94.             m_aExhaust[0] = new TEParticleFX(Tmp, 2, 4, 1.3f, 0, 0, 0, m_Up, 250, 1000,
  95.                 255, 1.0f, true, false);
  96.             
  97.             m_aExhaust[0]->SetColor(255, 255, 255);
  98.  
  99.             pEngine->AddParticleSystem(m_aExhaust[0]);
  100.         }
  101.  
  102.         if(m_pMotor != NULL)
  103.             m_pMotor->Play3D(m_Center, m_Velocity, TESOUND_LOOP, 1.0f);
  104.     }
  105. };
  106.  
  107. #endif
  108.